<?php

$film_name = "../ptnhuan-web1/data/films.txt";

$film_path = realpath($film_name);

$file = fopen($film_path,"r") or exit("Loi");

$mang = array();

while(!feof($file))
{
    $mang[] = trim(fgets($file));
}

fclose($file);
?>
<?php foreach ($mang as $film): ?>
    <?php if (!empty($film)): ?>
        <?php $mang = explode(";", $film) ?>
<img src="public/image/films/<?php echo $mang[1]; ?>">
<?php echo $mang[2]; ?>
<?php echo $mang[3]; ?>
<a href="edits.php?if=<?php echo $mang[0]; ?>">Edit</a></br>
    <?php endif; ?>
<?php endforeach; ?>

